package com.lottery.service;

import com.lottery.dao.UserDao;
import com.lottery.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public List<User> getUsers() {
        return userDao.getUsers();
    }

    public int login(String username, String password) {
        return userDao.login(username, password);
    }

    public User getUser(String username) {
        return userDao.getUser(username);
    }

    public void resetPassword(String username, String oldPassword, String newPassword) {
        userDao.resetPassword(username, oldPassword, newPassword);
    }

    public int appLogin(String machine_number, String password) {
        return userDao.appLogin(machine_number, password);
    }
}
